//
//  ZHIndicatorCustomView.swift
//  ZHPageView
//
//  Created by Rango on 2020/9/7.
//  Copyright © 2020 Rango. All rights reserved.
//

import UIKit

enum ArrowDirection {
    case top
    case lef
    case bottom
    case right
}

class ZHIndicatorCustomView: UIView {
    override func draw(_ rect: CGRect) {
        super.draw(rect)
        
        let kWidth: CGFloat = bounds.width
        let kHeight: CGFloat = bounds.height
        
        let bezier = UIBezierPath()
        let startP = CGPoint(x: kWidth / 2, y: 0)
        bezier.move(to: startP)
        bezier.addLine(to: CGPoint(x: kWidth * 2 / 3, y: kHeight / 2))
        bezier.addLine(to: CGPoint(x: kWidth * 5 / 6, y: kHeight / 4))
        bezier.addLine(to: CGPoint(x: kWidth, y: kHeight))
        bezier.addLine(to: CGPoint(x: 0, y: kHeight))
        bezier.addLine(to: CGPoint(x: kWidth / 6, y: kHeight / 4))
        bezier.addLine(to: CGPoint(x: kWidth / 3, y: kHeight / 2))
        bezier.addLine(to: startP)
        UIColor.red.setFill()
        bezier.fill()
    }
}
